import java.util.concurrent.CompletableFuture;

public class P01 {
    public static void main(String[] args) {
        CompletableFuture<String> cfl = CompletableFuture.supplyAsync(()->{
            try {
                Thread.sleep(1000);
            }catch (InterruptedException e){
                throw new RuntimeException(e);
            }
            return "HELLO ";
        })
                .thenApply(r->r+"OK");
        try {
            String result = cfl.get();
            System.out.println(result);
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }
}
